var express = require('express');
var router = express.Router();

// <<<<<<< HEAD
// <<<<<<< HEAD
const PswService = require("../services/psw/psw-services.js");
// =======
//用户业务逻辑处理对象
const UserService = require("../services/user/user_service.js");
// >>>>>>> 602f38b9f7e93fd6e8a53cb2f209dc372086273f

// =======
// >>>>>>> 79c9b497f3c65895301f80ba782aa12597a0c8a1
/* GET users listing. */
router.get('/', function(req, res, next) {
  res.send('respond with a resource');
});

// <<<<<<< HEAD
// <<<<<<< HEAD
router.post("/psw" , PswService.modify);
// =======
// 登录：完整路径"/api/users/login"
router.post("/login",UserService.login);

// 注册：完整路径"/api/users/register"
// router.post("/register",UserService.register);

// 注销
router.get("/logout",UserService.logout);

// >>>>>>> 602f38b9f7e93fd6e8a53cb2f209dc372086273f

// <<<<<<< HEAD
// 添加用户
// 完整URL: "/api/users/add"
router.post("/add", UserService.add);

// 按页查询用户
// "/api/users/find_by_page?page=5"
router.get("/find_by_page",UserService.findByPage);

// 按id查询用户
// "/api/users/find_by_id?id="
router.get("/find_by_id",UserService.findById);

// 模糊查询用户信息
// "/api/users/query"
router.get("/query",UserService.query);

// 更新修改
// 完整URL: "/api/users/update"
router.post("/update", UserService.update);

// 删除用户信息
// 完整URL: "/api/users/delete"
router.post("/delete", UserService.delete);



module.exports = router;
